<template>
  <!-- width 100vw 页面使用 -->
  <van-search
    @keydown.enter="sear"
    v-model="search_val"
    placeholder="请输入搜索关键词"
  />
</template>

<script>
// 导入 axios api
import { getSearch } from "@/request/api.js";
export default {
  props: ["cates_cards"],
  data() {
    return {
      search_val: "",
    };
  },
  methods: {
    async sear() {
      if (this.$route.path != "/search") {
        this.$router.push(`/search?keywords=${this.search_val}`);
      }
    },
  },
};
</script>

<style>
</style>